package com.bertie.smiles2iupac;

import java.util.ArrayList;
import java.util.List;

public class AtomsChain {
    List<Atom> atoms = new ArrayList<Atom>();

    public AtomsChain() {
    }
    
	private AtomsChain(List<Atom> atoms) {
		this.atoms = atoms;
	}

    public List<Atom> getAtoms() {
        return new ArrayList<Atom>(atoms);
    }

    public Atom lastAtom() {
        return atoms.get(atoms.size() - 1);
    }

    public void add(Atom atom) {
        atoms.add(atom);
    }

    public boolean contains(Atom atom) {
        return atoms.contains(atom);
    }

    public AtomsChain copy() {
        return new AtomsChain(new ArrayList<Atom>(this.atoms));
    }
}
